using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class sc_PatInfoMap : EntityTypeConfiguration<sc_PatInfo>
    {
        public sc_PatInfoMap()
        {
            // Primary Key
            this.HasKey(t => new { t.VIP, t.Pedodontics });

            // Properties
            this.Property(t => t.Patient_Name)
                .HasMaxLength(60);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(60);

            this.Property(t => t.case__)
                .HasMaxLength(15);

            this.Property(t => t.age)
                .HasMaxLength(15);

            this.Property(t => t.Patient_)
                .HasMaxLength(15);

            this.Property(t => t.VIP)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.Home_Phone)
                .HasMaxLength(30);

            this.Property(t => t.Address)
                .HasMaxLength(200);

            this.Property(t => t.City)
                .HasMaxLength(30);

            this.Property(t => t.State)
                .HasMaxLength(3);

            this.Property(t => t.Zip)
                .HasMaxLength(14);

            this.Property(t => t.Birth_Date)
                .HasMaxLength(12);

            this.Property(t => t.Work_Phone_1)
                .HasMaxLength(19);

            this.Property(t => t.Work_Phone_2)
                .HasMaxLength(19);

            this.Property(t => t.Mobile)
                .HasMaxLength(19);

            this.Property(t => t.FAX)
                .HasMaxLength(19);

            this.Property(t => t.Pedodontics)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.Gender)
                .HasMaxLength(7);

            // Table & Column Mappings
            this.ToTable("sc_PatInfo");
            this.Property(t => t.Patient_Name).HasColumnName("Patient Name");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic Name");
            this.Property(t => t.case__).HasColumnName("case #");
            this.Property(t => t.age).HasColumnName("age");
            this.Property(t => t.Patient_).HasColumnName("Patient#");
            this.Property(t => t.VIP).HasColumnName("VIP");
            this.Property(t => t.Home_Phone).HasColumnName("Home Phone");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.City).HasColumnName("City");
            this.Property(t => t.State).HasColumnName("State");
            this.Property(t => t.Zip).HasColumnName("Zip");
            this.Property(t => t.Birth_Date).HasColumnName("Birth Date");
            this.Property(t => t.Work_Phone_1).HasColumnName("Work Phone 1");
            this.Property(t => t.Work_Phone_2).HasColumnName("Work Phone 2");
            this.Property(t => t.Mobile).HasColumnName("Mobile");
            this.Property(t => t.FAX).HasColumnName("FAX");
            this.Property(t => t.Pedodontics).HasColumnName("Pedodontics");
            this.Property(t => t.Gender).HasColumnName("Gender");
        }
    }
}
